<?php

# 升级房子

$lv = $_REQUEST['level'] + 1;

if($_REQUEST['type'] == '1') {
	//窝
	$itemarr = array("1" => 0, "2" => 3000, "3" => 20000, "4" => 60000, "5" => 120000, "6" => 210000, "7" => 300000, "8" => 400000);
	$levelarr = array("1" => 0, "2" => 1, "3" => 4, "4" => 8, "5" => 12, "6" => 16, "7" => 20, "8" => 24);
} else {
	//棚
	$itemarr = array("1" => 5000, "2" => 40000, "3" => 90000, "4" => 160000, "5" => 250000, "6" => 350000, "7" => 500000, "8" => 700000);
	$levelarr = array("1" => 2, "2" => 6, "3" => 10, "4" => 14, "5" => 18, "6" => 22, "7" => 26, "8" => 28);
}

if(array_key_exists($lv, $itemarr)) {
	echo '{"level":' . $levelarr[$lv] . ',"money":' . $itemarr[$lv] . '}';
}

?>